<?php
// 返回所有数据
include 'base.php';
$username = $_POST['username'];
$sql = "SELECT * FROM `user` WHERE `username`='$username'";

$res = $conn->query($sql);

if($row = mysqli_fetch_assoc($res)){
  echo "该账号已注册";
}

